package orz.itrip.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import orz.itrip.pojo.AreaDic;
import orz.itrip.pojo.Hotel;
import orz.itrip.pojo.Image;
import orz.itrip.vo.HotelDetailsVo;
import orz.itrip.vo.HotelVedioVo;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface HotelMapper extends Mapper<Hotel> {

    HotelVedioVo selectVedio(Long hotelId);
    @Select("SELECT ild.`name`,ild.description FROM itrip_label_dic ild,itrip_hotel_feature ihf WHERE ild.id=ihf.featureId AND ihf.hotelId=#{hotelId}")
    List<HotelDetailsVo> selectByDetails(Long hotelId);
    @Select("SELECT ii.imgUrl,ii.position FROM itrip_image ii WHERE ii.targetId=#{hotelId} AND ii.type=#{typeId}")
    List<Image> selectImage(@Param("hotelId") Long hotelId, @Param("typeId") Integer typeId);

    @Select("SELECT * FROM itrip_area_dic WHERE isChina=#{isChina} AND isHot=1")
    List<AreaDic> selectHotCity(@Param("isChina") Long isChina);

    @Select("SELECT * FROM itrip_area_dic WHERE parent=#{parentId}")
    List<AreaDic> selectCityArea(@Param("parentId") Long parentId);
}